package cn.tansanqinger.dao.sql.chatroom;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import cn.tansanqinger.dao.sql.IGroupMemberSqlDao;
import cn.tansanqinger.pojo.GroupMember;

@Repository
public class GroupMemberSqlDaoImpl {

	@Autowired
	private IGroupMemberSqlDao dao;
	
	/**
	 * 查询用户好友
	 * @param grade
	 * @return
	 */
	public List<GroupMember> selectMessage(int id){
		QueryWrapper<GroupMember> queryWrapper = new QueryWrapper<GroupMember>();
		queryWrapper.lambda().eq(GroupMember::getMid, id);
		return dao.selectList(queryWrapper);
	}
	
	
	/**
	 * 添加信息
	 * @param course
	 * @return
	 */
	public int add(GroupMember object) {
		return dao.insert(object);
	}
	
	/**
	 * 查询信息
	 * @param cid
	 * @return
	 */
	public GroupMember selectOnt(int id) {
		return dao.selectById(id);
	}
	
	/**
	 * 修改状态
	 * @param cid
	 * @param isuse
	 * @return
	 */
	public int updateStatus(GroupMember object) {
		return dao.updateById(object);
	}
	
	/**
	 * 删除信息
	 * @param cid
	 * @return
	 */
	public int deleteOne(int id) {
		return dao.deleteById(id);
	}
	
	/**
	 * 修改信息
	 * @param user
	 * @return
	 */
	public int modification(GroupMember object) {
		return dao.updateById(object);
	}
	
}
